<?php
use \tpfcore\Core;
?>
<!doctype html>
<head>
        <meta charset="utf-8">
        <!-- Set render engine for 360 browser -->
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- HTML5 shim for IE8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js">
            </script>
        <![endif]-->
        <link href="{$admin_assets_path}/css/theme.min.css" rel="stylesheet">
        <link href="{$admin_assets_path}/css/simplebootadmin.css" rel="stylesheet">
        <link href="{$admin_assets_path}/css/default.css" rel="stylesheet" />
        <link href="{$admin_assets_path}/css/font-awesome.min.css" rel="stylesheet" type="text/css">
        <style>
            .length_3{width: 180px;} form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
            .table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;} .table-list{margin-bottom:
            0px;}
        </style>
        <!--[if IE 7]>
            <link rel="stylesheet" href="{$admin_assets_path}/css/font-awesome-ie7.min.css">
        <![endif]-->
        <script type="text/javascript">
            //全局变量
            var GV = {
                WEB_ROOT:"",
                DIMAUB: "/",
                JS_ROOT: "/theme/backend/assets/js/",
                TOKEN: ""
            };
        </script>
        <!-- Le javascript==================================================-
        -> <!-- Placed at the end of the document so the pages load faster -->
        <script src="{$admin_assets_path}/js/jquery.js"></script>
        <script src="{$admin_assets_path}/js/wind.js"></script>
        <script src="{$admin_assets_path}/js/bootstrap.min.js"></script>
        <script src="{$admin_assets_path}/kindeditor/kindeditor-min.js"></script>
        <link href="{$admin_assets_path}/kindeditor/themes/default/default.css" rel="stylesheet"/>
        <style type="text/css">.btn{padding:2px 8px; font-size: 14px;}</style>
    </head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('mall/GoodsAttribute/index',['type_id'=>$type_id])}">属性列表</a></li>
        <li><a href="{:url('mall/GoodsAttribute/add',['type_id'=>$type_id])}">添加属性</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:url('mall/GoodsAttribute/index')}">
        <select name="type_id" class="selector">
            <option value="0">全部属性</option>
            {volist name="listGoodsType" id="gt"}
            <option value="{$gt.id}" {eq name="type_id" value="$gt.id"}selected="selected"{/eq}>{$gt.name}</option>
            {/volist}
            {$categorys|default=""} 
        </select> &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索">
    </form>
    <form method="post" class="js-ajax-form" action="term/listorders">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th width="50">id</th>
                    <th>属性名称</th>
                    <th>商品类型</th>
                    <th>属性值的录入方式</th>
                    <th>可选值列表</th>
                    <th>排序</th>
                    <th width="140">操作</th>
                </tr>
            </thead>
            <tbody>
                {empty name="list"}
                <tr><td colspan="7">没有数据</td></tr>
                {else/}
                {foreach name="list" item="vo"}
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.name}</td>
                    <td>
                        {volist name="listGoodsType" id="gt"}
                        {eq name="vo.type_id" value="$gt.id"}{$gt.name}{/eq}
                        {/volist}
                    </td>
                    <td>
                       {if condition="$vo.input_type eq 0"}手工录入
                       {elseif condition="$vo.input_type eq 1"/}从列表中录入
                       {else/}多行文本框
                       {/if}
                    </td>
                    <td>
                        {$vo.input_values}
                    </td>
                    <td>
                        <input type="text" data="GoodsAttribute|sort|id|{$vo.id}" value="{$vo.sort}" class="ajax-text" action="{:url('mall/GoodsAttribute/ajaxdata')}"/>
                    </td>
                    <td>
                        <a href="{:url('mall/GoodsAttribute/add',['id'=>$vo['id']])}">编辑</a> |
                        <a href="{:url('mall/GoodsAttribute/del',['id'=>$vo['id']])}" class="js-ajax-delete">删除</a>
                    </td>
                </tr>
                {/foreach}
                {/empty}
            </tbody>
        </table>
        {notempty name="list"}
            <div class="pagination text-center">{$list->render()}</div>
        {/notempty}
    </form>
</div>
<script src="{$admin_assets_path}/js/common.js"></script>
</body>
</html>